package com.newsee.remote.contract.controller;


import com.newsee.remote.common.dto.contract.ContractDTO;
import com.newsee.remote.common.dto.sapcenter.companycode.CompanyCodeDTO;
import com.newsee.remote.common.vo.costcenter.CostCenterVO;
import com.newsee.remote.contract.service.IShContractService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  sap合同主数据前端控制器
 * </p>
 *
 * @author liangzhichen
 * @since 2019-12-16
 */
@RestController
@RequestMapping("/sap/contract")
@Slf4j
public class ShContractController {

    private final IShContractService iShContractService;

    public ShContractController(IShContractService iShContractService) {
        this.iShContractService = iShContractService;
    }

    @ApiOperation(value = "接收合同主数据接口")
    @PostMapping
    public CostCenterVO acceptContract(@RequestBody ContractDTO dto) {
        log.info("接收合同主数据接口信息：" + dto.toString());
        return iShContractService.acceptContract(dto);
    }

}
